Repository navigation
Handle saving of product with no variants specified - #389
Conversation
|
I've signed the CLA, but I don't know how to refresh it... |
|
Thanks! |
|
I believe there's an issue with this PR. It throws an error when loading a product, editing it and then saving it. Longer discussion here. Reproduce using: Dockerfile: main.py (example from here): When running, this throws the error: |
|
Hello! So I'm back working with the same code, and the issue is still here but in another form. The default stable package at the moment, If I go back to version It seems to me that you should test the documented code for creating a new product before releasing a new api version, since its a critical blocker use case, or maybe I'm doing something wrong? I hope this report is useful, and thank you for the API |
|
@rnovacek , any chance you can take a look at this issue? There are multiple reports of it by now. |
Amended pull request #389 to allow saving of products with no variants


Shopify API allows not setting all the attributes when changing a resource. It can be used as optimization to speed up things if some parts of a resource doesn't change.
Common scenario is to prevent variants update when saving product as there can be up to 100 variants per product and saving all takes a long time.
Recent update to delete
inventory_quantityandold_inventory_quantityof variants when saving product broke the ability to delete variants to prevent them from saving. It was working fine in version 7.0.0.This PR adds a check if the
variantsare defined on a product before attempt to deleteinventory_quantityandold_inventory_quantitywhen saving.